<?php
Zend::loadClass('Lead_EDO_Datatype_Field');

/**
 * Datatype for text
 * 
 * @package EDO
 * @subpackage Datatypes
 *
 */
class Lead_EDO_Datatype_Text extends Lead_EDO_Datatype_Field 
{
	protected $_SQLValueIsQuoted = true;
		
	function validate($validate)
	{
		if(!$this->notNull() AND empty($validate))
			return null;
		
		if(is_string($validate))
		{
			if(strlen($validate) <= 65535)
			{
				if($this->notNull() AND strlen($validate) == 0)
				    return false;
			    
			    return $validate;
			}
			
			
			
		}
		
		
		return false;
		
	}
	
	
	public function getDisplayValue()
	{
	    $text = $this->getValue();
	    $text = nl2br($text);
	    return $text;
	}
	
	
	
}
?>